import { defineStore } from "pinia";

export const useRepairStore = defineStore("repair", {
  state: () => ({
    orderInfo: {
      id: "",
      repairCode: "",
      repairSubject: "",
      repairType: "报修工单",
      status: 4,
    },
  }),

  actions: {
    // 设置工单信息
    setOrderInfo(info) {
      this.orderInfo = {
        ...this.orderInfo,
        ...info,
      };
    },

    // 清空工单信息
    clearOrderInfo() {
      this.orderInfo = {
        id: "",
        repairCode: "",
        repairSubject: "",
        repairType: "报修工单",
        status: 4,
      };
    },
  },
});
